package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextPane;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JCheckBox;
import java.awt.Font;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.ImageIcon;

public class UpdateCustomer extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JTable table;
	private JTable table_1;
	private JTable table_2;
	private JTextField textField_1;
	private JLabel lblCustomerDetails;
	private JButton btnBack;
	private JButton btnCancel;
	private JLabel lblNewLabel_1;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UpdateCustomer frame = new UpdateCustomer();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the Update Customer frame.
	 */
	public UpdateCustomer() {
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 629, 365);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		textField = new JTextField();
		textField.setBounds(15, 168, 107, 20);
		textField.setColumns(10);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setBounds(15, 136, 107, 20);
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"", "customer ID", "user Name ", "customer first name", "customer last name", "customer phone number", "customer Email", "member number"}));
		
		JButton btnUpdate = new JButton("Update");
		btnUpdate.setBounds(26, 220, 96, 23);
		
		JLabel lblChoose = new JLabel("choose field to update : ");
		lblChoose.setFont(new Font("Tahoma", Font.BOLD, 11));
		lblChoose.setBounds(15, 96, 141, 14);
		
		JLabel lblUpdateCustomer = new JLabel("Update customer");
		lblUpdateCustomer.setBounds(302, 16, 151, 22);
		lblUpdateCustomer.setFont(new Font("Tahoma", Font.ITALIC, 18));
		
		table = new JTable();
		table.setBounds(218, 212, 1, 1);
		
		table_1 = new JTable();
		table_1.setBounds(281, 109, 1, 1);
		
		table_2 = new JTable();
		table_2.setBounds(154, 112, 162, 101);
		table_2.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"customer ID", "customer first name"
			}
		));
		
		JButton btnSerchUser = new JButton("commit");
		btnSerchUser.setBounds(469, 208, 89, 23);
		btnSerchUser.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		
		textField_1 = new JTextField();
		textField_1.setBounds(349, 121, 86, 20);
		textField_1.setToolTipText("insert ID");
		textField_1.setColumns(10);
		
		JLabel lblNewLabel = new JLabel("choose customer : ");
		lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		lblNewLabel.setBounds(339, 96, 133, 14);
		lblNewLabel.setToolTipText("");
		
		lblCustomerDetails = new JLabel("customer details : ");
		lblCustomerDetails.setFont(new Font("Tahoma", Font.BOLD, 11));
		lblCustomerDetails.setBounds(165, 96, 151, 14);
		
		btnBack = new JButton("Back");
		btnBack.setBounds(471, 289, 87, 23);
		btnBack.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				WorkerGUI frame = new WorkerGUI();
				frame.setVisible(true);
				dispose();
			}
		});
		contentPane.setLayout(null);
		contentPane.add(lblChoose);
		contentPane.add(textField);
		contentPane.add(comboBox);
		contentPane.add(btnUpdate);
		contentPane.add(table);
		contentPane.add(table_2);
		contentPane.add(table_1);
		contentPane.add(lblNewLabel);
		contentPane.add(textField_1);
		contentPane.add(btnSerchUser);
		contentPane.add(lblCustomerDetails);
		contentPane.add(lblUpdateCustomer);
		contentPane.add(btnBack);
		
		btnCancel = new JButton("Cancel");
		btnCancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		btnCancel.setBounds(469, 249, 89, 23);
		contentPane.add(btnCancel);
		
		lblNewLabel_1 = new JLabel("");
		lblNewLabel_1.setIcon(new ImageIcon("images//mount.jpg"));
		lblNewLabel_1.setBounds(0, 0, 613, 326);
		contentPane.add(lblNewLabel_1);
		lblNewLabel_1.setLayout(null);
	}
}
